08. Practice Solution #2

Practice Solution #2: Display a Breakdown of User Types

import pandas as pd

filename = 'chicago.csv'

# load data file into a dataframe
df = pd.read_csv(filename)

# print value counts for each user type
user_types = df['User Type'].value_counts()

print(user_types)

Outputs:

Subscriber    330
Customer       70
Name: User Type, dtype: int64